package projects.Olympic;

import java.util.Date;

public class Athlete {
	private int code;
	private String name;
	private String nation;
	private double height;
	private Date birthDate;
	
	public Athlete(){
		
	}

	public Athlete(int code,String name,String nation,double height,Date birthDate){
		this.code = code;
		this.name = name;
		this.nation = nation;
		this.height = height;
		this.birthDate = birthDate;
	}
	
	
	public int getCode(){
		return this.code;
	}
	
	public String getName(){
		return this.name;
	}

	public String getNation(){
		return this.nation;
	}
	
	public double getHeight(){
		return this.height;
	}
	
	public Date getbirthDate(){
		return this.birthDate;
	}
	
	
	public void setCode(int newCode){
		this.code = newCode;
	}
	
	public void setName(String newName){
		this.name = newName;
	}
	
	public void setNation(String newNation){
		this.nation = newNation;
	}
	
	public void setHeight(double newHeight){
		this.height = newHeight;
	}
	
	public void setBirthDate(Date newBirthDate){
		this.birthDate = newBirthDate;
	}
	
	@Override
	public boolean equals(Object o){
		Athlete a=(Athlete) o;
		return(this.code==a.getCode()&&this.name.equals(a.getName())&&this.nation.equals(a.getNation())&&this.height==a.getHeight()/*&&this.birthDate.equals(a.getbirthDate())*/);
	}
	@Override
	public int hashCode(){
		return this.name.hashCode()+this.nation.hashCode()+this.code+((int)this.height)+this.birthDate.hashCode();
	}
}
